package order.controller;


import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import order.pojo.param.OrderAddNewParam;
import order.service.IOrderService;
import order.web.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

@Slf4j
@RestController
@RequestMapping("/orders")
@Api(tags = "订单管理")
public class OrderController {
    @Autowired
    private IOrderService orderService;
    @PostMapping("/add-new")
    @ApiOperation("添加类别")
    @ApiOperationSupport(order = 100)
    public JsonResult addNew(@Valid OrderAddNewParam orderAddNewParam){
        log.debug("开始处理【添加类别】的请求，参数：{}", orderAddNewParam);
        orderService.orderAdd(orderAddNewParam);
        return JsonResult.ok();
    }
}
